function timeView(){
	var Canvas;
	var Ctx;
	var CanvasHight;
	var CanvasWidth;
	var Analyser;
	var Scalefactor = 1;//die 255 von den audio daten und die höhe vom canvas
    var DecreaseRate = 25; //higher is shorter
    var BarWidth = 5;
    var Run = false; 
    
	var init = function(){
//		$(".timeView", CORE.Element).html('<canvas></canvas>');
		$(".timeView", CORE.Element).append('<div class="overlay"></div>');
		Canvas = $(".timeView canvas", CORE.Element)[0];
		Ctx = Canvas.getContext("2d");
	
		//canvas width and height nachziehen wenn sich größe ändert
		//und auch den Factor neu setzten
		Canvas.height = CanvasHeight = $(".timeView canvas", CORE.Element).height();
		Canvas.width = CanvasWidth = $(".timeView canvas", CORE.Element).width();
		Analyser = CORE.getAnalyser();
		Analyser.smoothingTimeConstant = 0.8;
		Scalefactor = CanvasHeight/255*-1;
		CORE.attach("onStateChanged", onStateChanged);
		CORE.attach("onPositionChanged", onPositionChanged);
		update();
	};
	
	var update = function(){
		window.webkitRequestAnimationFrame(update, Canvas);
		if(!Run)return;
		var freqByteData = new Uint8Array(Analyser.frequencyBinCount);
		Analyser.getByteFrequencyData(freqByteData); //analyser.getByteTimeDomainData(freqByteData);
		Ctx.clearRect(0,0,CanvasWidth,CanvasHeight);
		Ctx.fillStyle = 'rgba(255,162,0,.5)';
		Ctx.lineCap = 'round';
		
//		Ctx.fillRect(1, CanvasHeight, 5, 200);	
	    var average = 0;
	    var barCount = 0;
		for (var i = 0; i < freqByteData.length-256; i++) {
			var magnitude = freqByteData[i];
			if(i%DecreaseRate == 0 && i != 0){
				average += magnitude;
				average = average/DecreaseRate;
				Ctx.fillRect(barCount*BarWidth, CanvasHeight, BarWidth, average * Scalefactor );
				average = 0;
				barCount++;
				//DecreaseRate = Math.log(i);
			}else{
				average += magnitude;
			}
		}
	};
	var positionToString = function(d){
//		var hour = Math.round(d/3600);
//		var rest = d-hour*3600;
		var min = Math.floor(d/60);
		var sec = d-min*60;
//		var sec = Math.round(rest*100)/100;
//		return hour+":"+min+":"+sec;
		return min+":"+Math.round(sec);
	};
	var onPositionChanged = function(e){
		var pos = e.position;
		var dur = e.duration;
		var process = e.process;
		
		
		$(".timeView .overlay", CORE.Element).html(positionToString(pos)+" / "+positionToString(dur));
//		
//		var newMarginLeft = 0-((CanvasWidth)-(process*CanvasWidth));
//		$(".timeView .processBar", CORE.Element).css("margin-left", newMarginLeft);

		//bekommt daten an welcher stelle der player is
		//ettweder als callback an CORE registrieren ... oder ander?
	};

	var onStateChanged = function(e){
		if(e.playing){ 
			Run = true;
		}else{
			Run = false;
		}
	};
	
	init();
}